<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>{$tpshop_config['shop_info_store_title']}</title>
    <meta name="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<link rel="stylesheet" href="__STATIC__/css/user.css" type="text/css">
    <script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/slider.js"></script>
    <script src="__PUBLIC__/js/global.js"></script>
</head>
<body>
<include file="Public/header" />
<include file="Public/topnav" />

<div class="page_pad">
  <div class="page_margin">
    <div class="page_radius">
      <div class="page_padin">
        <div class="regpage" style="padding:100px 0;">
          <div class="reg_tit"><div class="pad">忘记密码<span>已有账号？请<a href="{:U('Home/User/login')}">登录</a></span></div></div>
          <form id="forget_pwd" action="{:U('User/identity')}" method="post">
            <div class="ginput_div ginput_div_icon"><i class="icon-shouji1"></i><input class="ginput" type="text" name="username" id="username" placeholder="手机号" onBlur="chkuser()" /></div>
            <input type="hidden" name="type" value="forget">
            <div class="ginput_div ginput_div_icon"><i class="icon-mima"></i><input class="ginput" onKeyDown="if(event.keyCode==13){checkSubmit();}" type="text" name="verify_code" id="captcha" placeholder="请输入验证码" maxlength="4" /><span class="code"><img id="verify_code_img" class="verify_code_img_reg" src="/index.php?m=Home&c=User&a=verify" onclick="verify()"  /></span></div>
            <div class="ginput_div"><button type="button" class="login_sub" onclick="chkcaptcha();">下一步</button></div>
          </form>
        </div>
      </div><!--page_padin-->
    </div><!--page_radius-->
  </div><!--page_margin-->
</div><!--page_pad-->

<!--
<div id="user_container">

<div id="user_login">
		
       		<div class="wel-log">找回密码</div>
		
			
			
		<form id="forget_pwd" action="{:U('User/identity')}" method="post">
            
			  <div class="login-x">
                <div>
                    <table class="pa-10-0" width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td><input class="zc-text zc_u" type="text" name="username" id="username" onBlur="chkuser()" placeholder="手机号/邮箱"/>
                            <input type="hidden" name="type" value="forget">
							<span class="v-tips verify-tips" data-tips-for="username">
                            </td>
                        </tr>
                       
                        <tr>
                            <td>
                                <input class="zc-text zc_code" onKeyDown="if(event.keyCode==13){checkSubmit();}" type="text" name="verify_code" id="captcha" placeholder="{$Think.lang.logincode}"/>
                                <img id="verify_code_img"  src="/index.php?m=Home&c=User&a=verify&type=forget"  onclick="verify()" />
                                <span class="v-tips verify-tips" data-tips-for="captcha"><i class="icon">
                            </td>
                        </tr>
                        
                        <tr>
                            <td><input type="button" class="login" onClick="chkcaptcha()" value="下一步"><br ><br ><br ><br ><br ><br ></td>
                        </tr>
                    </table>
                </div>
            </div>
          </form>
			
			
		</div>
</div>
<div style="clear: both;"></div>-->
<include file="Public/footer" />
<script>
	function verify(){
		$('#verify_code_img').attr('src','/index.php?m=Home&c=User&a=verify&r='+Math.random());
	}

	var uflag = false;
	var cflag = false;

	function chkuser(){
		//$('span[data-tips-for="username"]').find('.txt').empty();
		var username = $('#username').val();
		if(username == ''){
			//show_error('username','用户名不能为空');
			$.artTip('用户名不能为空.', 800);
			return false;
		}else{
			$.ajax({
				url:'/index.php?m=Home&c=User&a=check_username&t='+Math.random(),
				type:'post',
				dataType:'json',
				data:{username:username},
				success:function(t){



					if(t==1){
						uflag = true;
					}else{
						$.artTip('用户名错误.', 800);
						$("#username").focus();
					}
				}
			})
		}
	}

	function chkcaptcha(){
		//$('span[data-tips-for="captcha"]').find('.txt').empty();
		var captcha = $('#captcha').val();
		if(captcha == ''){
			$.artTip('验证码不能为空.', 800);
			return false;
		}else if(captcha.length!=4){
			
			$.artTip('验证码错误.', 800);
			return false;
		}else{
			$.ajax({
				url:'/index.php?m=Home&c=User&a=check_captcha&t='+Math.random(),
				type:'post',
				dataType:'json',
				data:{verify_code:captcha},
				success:function(t){
					if(t==1){
						/*$('span[data-tips-for="captcha"]').css('display','inline');
						$('span[data-tips-for="captcha"]').find('i').removeClass('icon');
						$('span[data-tips-for="captcha"]').find('i').removeClass('icon-warn');
						$('span[data-tips-for="captcha"]').find('i').addClass('icon-loss');
						$('span[data-tips-for="captcha"]').find('.txt').empty();*/
						cflag = true;
						gonext();
					}else{
						$.artTip('验证码不正确.', 800);
						return false;
					}
				}
			})
		}
	}

	function gonext(){
		if($('#username').val() == ''){
			$.artTip('用户名不能为空.', 800);
			return;
		}
		if($('#captcha').val() == ''){
			$.artTip('验证码不能为空.', 800);
			return;
		}
	/*	if(!uflag){
			$.artTip('用户名验证有误.', 800);
			return;
		}else if(!cflag){
			$.artTip('图形验证码有误.', 800);
			return;
		}
		if(uflag && cflag){
			$('#forget_pwd').submit();
		}*/

        $('#forget_pwd').submit();
	}

	function show_error(type,msg){
		$('span[data-tips-for="'+type+'"]').css('display','inline');
		$('span[data-tips-for="'+type+'"]').find('i').removeClass('icon');
		$('span[data-tips-for="'+type+'"]').find('i').removeClass('icon-loss');
		$('span[data-tips-for="'+type+'"]').find('i').addClass('icon-warn');
		$('span[data-tips-for="'+type+'"]').find('.txt').empty().html(msg);
	}
</script>
</body>
</html>